//
//  SISSAnnotationView.m
//  SISSAPP
//
//  Created by 优房网 on 2017/3/16.
//  Copyright © 2017年 优房网. All rights reserved.
//

#import "SISSRoundAnnotationView.h"

@interface SISSRoundAnnotationView ()

@property(nonatomic, strong) UILabel *titleLabel;
@property(nonatomic, strong) UILabel *subTitleLabel;

@end
@implementation SISSRoundAnnotationView

- (id)initWithAnnotation:(id<BMKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier]) {
        [self setBounds:CGRectMake(0.f, 0.f, 66, 66)];
        [self setContentView];
    }
    return self;
}

- (void)setContentView {
    
//    UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"地图bg1"]];
    UIImage *image = [UIImage imageNamed:@"地图bg1"];
    self.layer.contents = (id)image.CGImage;
    self.layer.cornerRadius = 33;
//    self.layer.borderColor = color.CGColor;
//    self.layer.borderWidth = 1;
//    self.layer.masksToBounds = YES;
//    self.backgroundColor = color;
    self.alpha = 0.8;
    self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 12, CGRectGetWidth(self.frame), 16)];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    self.titleLabel.font = FONT(10);
    self.titleLabel.textColor = [UIColor whiteColor];
    self.titleLabel.layer.masksToBounds = YES;
    [self addSubview:self.titleLabel];
    
    self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(self.titleLabel.frame), CGRectGetWidth(self.frame), 16)];
    self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
    self.subTitleLabel.font = FONT(8);
    self.subTitleLabel.textColor = [UIColor whiteColor];
    self.subTitleLabel.layer.masksToBounds = YES;
    [self addSubview:self.subTitleLabel];
    
}

- (void)setTitle:(NSString *)title {
    _title = title;
    self.titleLabel.text = title;
}
- (void)setSubTitle:(NSString *)subTitle {
    _subTitle = subTitle;
    self.subTitleLabel.text = subTitle;
}



@end
